package com.xiaouyudeguang.common.console;

import com.xiaouyudeguang.common.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Console {

    private static final Logger log = LoggerFactory.getLogger(Console.class);

    public static String log(Object... objs) {
        StringBuilder str = new StringBuilder();
        for (Object obj : objs) {
            str.append(", ").append(obj);
        }
        log.info(str.substring(1));
        return str.substring(1);
    }

    public static String out(Object... objs) {
        StringBuilder str = new StringBuilder();
        for (Object obj : objs) {
            str.append(", ").append(obj);
        }
        System.err.println(DateUtils.getNow() + " " + str.substring(1));
        return str.substring(1);
    }
}
